<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        //<cc:attribute name="bill" type="com.divudi.entity.Bill" />
        <cc:attribute name="dup"/>
        <cc:attribute name="refund"/>
        <cc:attribute name="cancell"/>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>


        <h:panelGroup>
            <h:outputStylesheet library="css" name="printing_rmh.css"></h:outputStylesheet>

            <div class="fiveinchbillRmh">

                <h:panelGroup id="gpBillPreviewRmh" >


                    <div class="errorMessage" >
                        <h:outputLabel rendered="#{cc.attrs.bill.transError}"
                                       style="font-size: 15px!important; 
                                       font-weight: bolder!important;
                                       position: absolute!important;
                                       left: 7.0%!important;
                                       top: 2.0%!important;"
                                       value=" THIS BILL IS NOT VALID PLEASE CANCEL."/>
                    </div>

                    <div style="font-size: 18px!important;">

                        <h:outputLabel value="#{cc.attrs.bill.insId}" rendered="#{cc.attrs.dup eq false}"
                                       styleClass="opdRefNo"/>


                        <h:outputLabel value="#{cc.attrs.bill.cancelledBill.insId} **Cancelled"  
                                       rendered="#{cc.attrs.bill.cancelledBill.insId ne null 
                                                   and cc.attrs.bill.cancelled eq true}"
                                       styleClass="opdBillHeading"/> 

                        <h:outputLabel value="#{cc.attrs.bill.refundedBill.insId} **Refunded" 
                                       rendered="#{cc.attrs.bill.refundedBill.insId ne null 
                                                   and cc.attrs.bill.refunded eq true}"
                                       styleClass="opdBillHeading"/> 

                        <h:outputLabel value="#{cc.attrs.bill.insId} **Duplicate" 
                                       rendered="#{cc.attrs.bill.refundedBill.insId eq null and
                                                   cc.attrs.bill.cancelledBill.insId eq null 
                                                   and cc.attrs.dup eq true}"
                                       styleClass="opdBillHeading"/>
                    </div>

                    <div class="opdAppNo" style="font-size: 16px;
                         position: absolute;
                         left: 25%;
                         top: 30%;" >                       
                        <h:outputLabel value="#{cc.attrs.bill.billDate}" style="font-size: 16px;">
                            <f:convertDateTime pattern="dd/MM/yy"/>
                        </h:outputLabel>
                    </div>

                   
                    <div class="opdConsultant" style="font-size: 18px;
                         position: absolute;
                         left: 33%;
                         top: 41%;" >
                        <h:panelGroup>
                            <h:outputLabel value="#{cc.attrs.bill.referredBy.person.nameWithTitle}" style="font-size: 18px;"/>                              
                        </h:panelGroup>
                    </div>

                    
                    <div class="opdPatientName" style="font-size: 18px;
                         position: absolute;
                         left: 28%;
                         top: 48%;">
                        <h:outputLabel value="#{cc.attrs.bill.patient.person.nameWithTitle}" style="font-size: 20px;" >
                        </h:outputLabel>
                        
                        <h:outputLabel value="#{cc.attrs.bill.patient.age}" style="margin-left: 15px; font-size: 20px;">
                        </h:outputLabel>
                    </div>

                    
<!--                    <div style="position:absolute!important;
                        left:80%!important;
                        top: 90%!important;">
                        <h:outputLabel value="#{cc.attrs.bill.creater.code}555">
                        </h:outputLabel>
                    </div>-->

                   


                    <div style="font-size: 16px!important;
                         position: absolute;
                         left: 15%;
                         top: 55%;" >
                        <h:dataTable value="#{cc.attrs.bill.billItems}" var="bip"   >
                            <h:column >

                                <h:outputLabel rendered="#{bip.item.department.id eq cc.attrs.bill.toDepartment.id}" value="#{bip.item.printName}" style="margin: 4px; font-size: 20px!important;" >
                                </h:outputLabel>
                                
                                
<!--                                <h:panelGroup rendered="#{bip.item.department.id eq cc.attrs.bill.toDepartment.id and bip.billSession ne null }"  >
                                    <br/>
                                    <br/>
                                    <h:panelGroup rendered="#{bip.item.sessionNumberType ne null}">
                                        <h:outputLabel value="Session2 No . " style="margin: 4px; font-size: 12px!important; font-weight: bold;"></h:outputLabel>
                                        <h:outputLabel value="#{bip.billSession.serialNo}999" style="margin: 4px; font-size: 20px!important; font-weight: bold;" >
                                        </h:outputLabel>
                                    </h:panelGroup>
                                </h:panelGroup>-->
                            </h:column>
                        </h:dataTable>
                        <h:outputLabel style="font-size: 22px!important; font-weight: bold;" value="_____________________________ " />
                        <div style="margin-top: 20px; margin-left: 15px;">
                            
                            <h:outputLabel style="font-size: 22px!important; font-weight: bold;" value="TOTAL " />
                        </div>
                        
                    </div>
                    
                    <div style="position: absolute;
                         font-size: 20px;
                         left: 70%;
                         top: 55%;
                         text-align: right;"  >
                        <h:dataTable value="#{cc.attrs.bill.billItems}" var="bip1"  >
                            <h:column >
                                <h:outputLabel  rendered="#{bip1.bill.id eq cc.attrs.bill.id}"  value="#{bip1.grossValue}"  style="font-size: 20px!important;" >
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputLabel>
                            </h:column>
                        </h:dataTable>
                        <h:outputLabel style="font-size: 22px!important; font-weight: bold;" value="_" />
                        <div style="margin-top: 20px;">
                            
                            <h:outputLabel style="font-size: 22px!important; font-weight: bold;" value="#{cc.attrs.bill.total}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </div>
                        
                    </div>

<!--                    
                    <div class="totalsPrintingRuhunu">

                        <table>
                            
                            <tr>
                                <td style="text-align: left; font-size: 14px; width: 30px;">
                                    <h:outputLabel value="TOTAL " />
                                </td>
                                
                                <td style="text-align: right!important; font-size: 14px; margin-left: 150px;">
                                    <h:outputLabel value="#{cc.attrs.bill.total}">
                                        <f:convertNumber pattern="#,##0.00" />
                                    </h:outputLabel>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: left;">
                                    <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}" style=" text-align: right!important;  font-size: 15px!important;   "  value="Discount"/>
                                </td>
                                <td style="text-align: right!important; ">
                                    <h:outputLabel rendered="#{cc.attrs.bill.discount ne 0.0}"   value="#{cc.attrs.bill.discount}"  style=" text-align: right!important;  font-size: 15px!important;   ">
                                        <f:convertNumber pattern="#,##0.00" />
                                    </h:outputLabel>
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: left;">
                                    <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}"    value="Net Total" style=" text-align: right!important;  font-size: 15px!important;   "/>
                                </td>
                                <td style="text-align: right!important; ">
                                    <h:outputLabel  rendered="#{cc.attrs.bill.discount ne 0.0}"    value="#{cc.attrs.bill.netTotal}"  style="font-weight: bold ; text-align: right!important; font-size: 15px!important;    ">
                                        <f:convertNumber pattern="#,##0.00" />
                                    </h:outputLabel>
                                </td>
                            </tr>


                        </table>

                    </div>
-->


                </h:panelGroup>
            </div>
        </h:panelGroup>                

    </cc:implementation>
</html>
